#include "jianzhi/6.h"
#include "gtest/gtest.h"

TEST(TestJianzhiSolutions, TestProblem6)
{
    jianzhi_6::Solution s;
    ListNode n1(1), n2(2), n3(3);
    n1.next = &n2;
    n2.next = &n3;
    auto result = s.reversePrint(&n1);
    vector<int> ans{3, 2, 1};

    ASSERT_EQ(result.size(), ans.size());
    for (int i = 0; i < result.size(); ++i)
    {
        ASSERT_EQ(result[i], ans[i]);
    }
}